package com.jinxin.platform.cdfaceacs.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-02-24
 * @Author: Lingnan
 **/
public class StringUtil {
    public static String getUuid() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "");
    }

//    private static final ObjectMapper objectMapper = new ObjectMapper();

//    public static String toJsonByObject(Object obj){
//        if(null == obj)return "";
//        String jsonStr = null;
//        try {
//            jsonStr =  objectMapper.writeValueAsString(obj);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return jsonStr.replaceAll("\\\\","");
//    }

//    public static void main(String[] args) {
//        JSONObject pJsonObj = new JSONObject();
//        pJsonObj.put("p1","12345678");
//        Map<String,Object> paramsMap = new HashMap<>();
//
//        paramsMap.put("id","123412");
//        paramsMap.put("idcardNum","");//卡号, 如不填，系统自动生成
//        paramsMap.put("name","发货圣诞节和");
//        pJsonObj.put("p2",JSON.toJSONString(paramsMap));
//        System.out.println(pJsonObj.toJSONString().replaceAll("\\\\",""));
//    }

}
